<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Service\Search;

use HyperfX\Utils\ElasticSearch;

class QuestionSearch extends ElasticSearch
{
    public function mapping(): array
    {
        return [
            'id' => ['type' => 'long'],
            'category_id' => ['type' => 'byte'],
            'user_id' => ['type' => 'long'],
            'title' => ['type' => 'text'],
            'summary' => ['type' => 'text'],
            'status' => ['type' => 'byte'],
        ];
    }

    public function index(): string
    {
        return 'legal_question';
    }

    public function type(): string
    {
        return 'question';
    }
}
